Tokens-database refactoring#14142
Conversation
b43f10c to
b23b831
Compare
b23b831 to
c811bd7
Compare
|
This needs rebasing given the flurry of changes to support ECC and ECL in recent weeks |
…t references to extracted params by one
…he last being non-optional for the Token Class Name
…lidation on TokenClassName values being non-empty
…ng as a result of earlier validation being present
d3ad6ff to
9b4b6b3
Compare
|
Rebased and tested with a locally built client that token data is loaded correctly and works in-game as expected. I think this is ready for review to ultimately address the TODO on deprecating |
| |TOK:M3C|Phyrexian Myr||BrudicladTelchorMyrToken| | ||
| |TOK:M3C|Sand Warrior||SandWarriorToken| | ||
| |TOK:M3C|Saproling||SaprolingToken| | ||
| |TOK:M3C|Shapeshifter|1|CribSwapShapeshifterWhiteToken| |
There was a problem hiding this comment.
Be careful, there are wrong replacements for ShapeshifterColorlessToken. New CribSwapShapeshifterWhiteToken do not exists in master. Maybe it was part of another PR.
There was a problem hiding this comment.
Ah I think this one got refactored in the ECL implementation piece. Good catch!
There was a problem hiding this comment.
Confirming, it got moved here b27d595#diff-ae49ddc2300428a173782dcdc55f78422bca6a1c69cd5937622346a94d5f6cb4
There was a problem hiding this comment.
This takes all unique declared Token class names in the txt file, and is checking that an equivalent file exists in Mage/src/main/java/mage/game/permanent/token
muz@m1 % for token in $(cat ../../../../../resources/tokens-database.txt | grep '^|TOK' | awk -F '|' '{print $5}' | sort | uniq); do if [ ! -f "$token.java" ]; then echo $token; fi; done
AnotherSpiritToken
ClueToken
KaroxBladewingToken
AnotherSpiritToken- Got renamed toSpirit33Tokenin Use specific tokens where possible for TDM #14153ClueToken- Should have been namedClueArtifactTokenall alongKaroxBladewingToken- We haveKaroxBladewingDragonToken
With those lines fixed too, I think that validates the same sort of thing you called out here where there're references to tokens where no file exists for one reason or another.
I had the idea of poking at systematically finding and generating tokens as new set data is released. To enable this, some understanding of the current database was needed on my side. I then saw
// TODO: remove "generate" from dbon the codebase and some codepaths that could be tidied up a bit...This should be a functional no-op to the end user, but internally:
tokens-database.txtare as expectedI was able to confirm that the existing data in database was consistently formatted with the same number of columns;
I was also able to confirm what used to be the ImageFileName column was empty for all rows;
Confirmed that the only thing reading the tokens-database.txt and in active use right now is
TokenRepository.javawith objects it extracts being consumed downstream in the project. The generated objects from the Repository should be consistent with before.I did note that there is a Unit Test for this class, but it's currently marked as
@Ignorewith// TODO: enable test after massive token fixesso opted to not touch this right now if the test itself is not exercising value. The changes it's expecting are well beyond the scope of what this PR seeks to achieve on closing out that aforementioned TODO